import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/get_plan_record_entity.dart';

GetPlanRecordEntity $GetPlanRecordEntityFromJson(Map<String, dynamic> json) {
  final GetPlanRecordEntity getPlanRecordEntity = GetPlanRecordEntity();
  final dynamic id = json['id'];
  if (id != null) {
    getPlanRecordEntity.id = id;
  }
  final dynamic taskId = json['taskId'];
  if (taskId != null) {
    getPlanRecordEntity.taskId = taskId;
  }
  final String? planId = jsonConvert.convert<String>(json['planId']);
  if (planId != null) {
    getPlanRecordEntity.planId = planId;
  }
  final dynamic createDate = json['createDate'];
  if (createDate != null) {
    getPlanRecordEntity.createDate = createDate;
  }
  final dynamic updateDate = json['updateDate'];
  if (updateDate != null) {
    getPlanRecordEntity.updateDate = updateDate;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    getPlanRecordEntity.createById = createById;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    getPlanRecordEntity.updateById = updateById;
  }
  final dynamic createBy = json['createBy'];
  if (createBy != null) {
    getPlanRecordEntity.createBy = createBy;
  }
  final dynamic updateBy = json['updateBy'];
  if (updateBy != null) {
    getPlanRecordEntity.updateBy = updateBy;
  }
  final dynamic deleted = json['deleted'];
  if (deleted != null) {
    getPlanRecordEntity.deleted = deleted;
  }
  final dynamic riskObjectId = json['riskObjectId'];
  if (riskObjectId != null) {
    getPlanRecordEntity.riskObjectId = riskObjectId;
  }
  final dynamic riskObjectName = json['riskObjectName'];
  if (riskObjectName != null) {
    getPlanRecordEntity.riskObjectName = riskObjectName;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    getPlanRecordEntity.riskUnitId = riskUnitId;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    getPlanRecordEntity.riskUnitName = riskUnitName;
  }
  final int? dangerNum = jsonConvert.convert<int>(json['dangerNum']);
  if (dangerNum != null) {
    getPlanRecordEntity.dangerNum = dangerNum;
  }
  final int? lateNum = jsonConvert.convert<int>(json['lateNum']);
  if (lateNum != null) {
    getPlanRecordEntity.lateNum = lateNum;
  }
  final int? reExaminationNum = jsonConvert.convert<int>(json['reExaminationNum']);
  if (reExaminationNum != null) {
    getPlanRecordEntity.reExaminationNum = reExaminationNum;
  }
  final int? taskNum = jsonConvert.convert<int>(json['taskNum']);
  if (taskNum != null) {
    getPlanRecordEntity.taskNum = taskNum;
  }
  return getPlanRecordEntity;
}

Map<String, dynamic> $GetPlanRecordEntityToJson(GetPlanRecordEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['taskId'] = entity.taskId;
  data['planId'] = entity.planId;
  data['createDate'] = entity.createDate;
  data['updateDate'] = entity.updateDate;
  data['createById'] = entity.createById;
  data['updateById'] = entity.updateById;
  data['createBy'] = entity.createBy;
  data['updateBy'] = entity.updateBy;
  data['deleted'] = entity.deleted;
  data['riskObjectId'] = entity.riskObjectId;
  data['riskObjectName'] = entity.riskObjectName;
  data['riskUnitId'] = entity.riskUnitId;
  data['riskUnitName'] = entity.riskUnitName;
  data['dangerNum'] = entity.dangerNum;
  data['lateNum'] = entity.lateNum;
  data['reExaminationNum'] = entity.reExaminationNum;
  data['taskNum'] = entity.taskNum;
  return data;
}

extension GetPlanRecordEntityExtension on GetPlanRecordEntity {
  GetPlanRecordEntity copyWith({
    dynamic id,
    dynamic taskId,
    String? planId,
    dynamic createDate,
    dynamic updateDate,
    dynamic createById,
    dynamic updateById,
    dynamic createBy,
    dynamic updateBy,
    dynamic deleted,
    dynamic riskObjectId,
    dynamic riskObjectName,
    String? riskUnitId,
    String? riskUnitName,
    int? dangerNum,
    int? lateNum,
    int? reExaminationNum,
    int? taskNum,
  }) {
    return GetPlanRecordEntity()
      ..id = id ?? this.id
      ..taskId = taskId ?? this.taskId
      ..planId = planId ?? this.planId
      ..createDate = createDate ?? this.createDate
      ..updateDate = updateDate ?? this.updateDate
      ..createById = createById ?? this.createById
      ..updateById = updateById ?? this.updateById
      ..createBy = createBy ?? this.createBy
      ..updateBy = updateBy ?? this.updateBy
      ..deleted = deleted ?? this.deleted
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..dangerNum = dangerNum ?? this.dangerNum
      ..lateNum = lateNum ?? this.lateNum
      ..reExaminationNum = reExaminationNum ?? this.reExaminationNum
      ..taskNum = taskNum ?? this.taskNum;
  }
}
